Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Transient fault handling issue with OpenAsync #1983

Merged
merged 4 commits into from
Apr 19, 2023

Conversation

cheenamalhotra
Copy link
Member

@cheenamalhotra cheenamalhotra commented Apr 5, 2023

Addresses #1982

'Retry', is a completion callback that is completed after CreateConnection() completes (which handles transient faults), here:

if (caughtException != null)
{
next.Completion.TrySetException(caughtException);
}
else if (timeout)
{
next.Completion.TrySetException(ADP.ExceptionWithStackTrace(ADP.PooledOpenTimeout()));
}
else
{
Debug.Assert(connection != null, "connection should never be null in success case");
if (!next.Completion.TrySetResult(connection))
{
// if the completion was cancelled, lets try and get this connection back for the next try
PutObject(connection, next.Owner);
}
}

So I don't see a reason to not enable transient fault handling retries when its specified.

@codecov
Copy link

codecov bot commented Apr 5, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.07 ⚠️

Comparison is base (a5ad838) 70.59% compared to head (80c4096) 70.52%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1983      +/-   ##
==========================================
- Coverage   70.59%   70.52%   -0.07%     
==========================================
  Files         306      306              
  Lines       61667    61725      +58     
==========================================
- Hits        43533    43532       -1     
- Misses      18134    18193      +59     
Flag Coverage Δ
addons 92.88% <ø> (ø)
netcore 73.23% <100.00%> (-0.17%) ⬇️
netfx 69.17% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...core/src/Microsoft/Data/SqlClient/SqlConnection.cs 78.86% <100.00%> (-0.36%) ⬇️
...etfx/src/Microsoft/Data/SqlClient/SqlConnection.cs 59.42% <100.00%> (ø)

... and 16 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@David-Engel
Copy link
Contributor

Nice. Thanks!

Co-authored-by: DavoudEshtehari <61173489+DavoudEshtehari@users.noreply.github.com>
@JRahnama JRahnama added this to the 5.2.0-preview1 milestone Apr 19, 2023
@Kaur-Parminder Kaur-Parminder merged commit 4a91443 into dotnet:main Apr 19, 2023
@cheenamalhotra cheenamalhotra deleted the fix-openAsync-retry branch April 20, 2023 07:15
kant2002 pushed a commit to kant2002/SqlClient that referenced this pull request Jun 29, 2023
DavoudEshtehari added a commit to DavoudEshtehari/SqlClient that referenced this pull request Oct 25, 2023
DavoudEshtehari added a commit to DavoudEshtehari/SqlClient that referenced this pull request May 16, 2024
…ing issue with OpenAsync (dotnet#1983)"

This reverts commit 80d1f47.

# Conflicts:
#	src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlConnectionBasicTests.cs
DavoudEshtehari added a commit to DavoudEshtehari/SqlClient that referenced this pull request May 16, 2024
…ing issue with OpenAsync (dotnet#1983)"

This reverts commit 80d1f47.

# Conflicts:
#	src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlConnectionBasicTests.cs
DavoudEshtehari added a commit to DavoudEshtehari/SqlClient that referenced this pull request May 16, 2024
DavoudEshtehari added a commit that referenced this pull request May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transient Fault Handling is disabled by default with SqlConnection.OpenAsync()
5 participants